<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>表单提交 02</title>
	</head>
	<!--四步: 1.定义div 2.引入JS类库 3.实例化vue对象 4.取值操作 {{}} -->
	<body>
		<div id="app">
			<!-- 属性说明:
					1.number 将用户输入变为数值类型
					2.trim   去掉开头和结尾的空格
					3.lazy   将input事件改为change事件(懒加载)
			 -->
			<input name="age" v-model.number="age"/>
			<button @click="add">+10</button>
			<br>
			<input name="name" v-model.trim="name"/>
			获取name属性的长度{{name.length}}
			<br>
			<input name="username" v-model.lazy="username"/>
			观察响应现象{{username}}
		</div>
		
		<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
		<script>
            const app = new Vue({
                el: '#app',
                data: {
                    age:'',
	                name:'',
	                username:''
                },
                methods: {
                    add(){
                        this.age=this.age+10
                    }
                }
            })
		</script>
	</body>
</html>